package com.gitee.feizns.zxw.commons.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
* @author feizns
* @since 2019/7/9
*/
@MapperScan("com.gitee.feizns.zxw.mapper")
@Configuration
public class DataAutoConfiguration {

    @ConfigurationProperties(prefix = "spring.datasource.druid")
    @Bean
    public DataSource dataSource() {
        return new DruidDataSource();
    }

}
